#include "app_buffer.h"
#include "log/log.h"

int main(int argc, char const *argv[])
{
    Buffer *buf = app_buffer_init(256);

    app_buffer_write(buf, "hello world", 11);
    app_buffer_write(buf, "ni hao shi jie", 14);
    char r_buf[20];
    int len;
    len = app_buffer_read(buf, r_buf, 20);
    log_debug("read %d bytes", len);
    log_debug("read data: %s", r_buf);

    char r_buf1[20];
    int len1;
    len1 = app_buffer_read(buf, r_buf1, 20);
    log_debug("read %d bytes", len1);
    log_debug("read data: %s", r_buf1);
    return 0;
}
